<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns the number of records affected by the query</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mssql-result.html">mssql_result</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mssql-select-db.html">mssql_select_db</a></div>
 <div class="up"><a href="ref.mssql.html">Mssql 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.mssql-rows-affected" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mssql_rows_affected</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5, PECL odbtp &gt;= 1.1.1)</p><p class="refpurpose"><span class="refname">mssql_rows_affected</span> &mdash; <span class="dc-title">Returns the number of records affected by the query</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mssql-rows-affected-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>mssql_rows_affected</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$link_identifier</code></span>
   )</div>

  <p class="para rdfs-comment">
   Returns the number of records affected by the last write query.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mssql-rows-affected-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">link_identifier</code></em></dt>

     <dd>

      <p class="para">
       A MS SQL link identifier, returned by
       <span class="function"><a href="function.mssql-connect.html" class="function">mssql_connect()</a></span> or
       <span class="function"><a href="function.mssql-pconnect.html" class="function">mssql_pconnect()</a></span>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mssql-rows-affected-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the number of records affected by last operation.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.mssql-rows-affected-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1520">
    <p><strong>Example #1 <span class="function"><strong>mssql_rows_affected()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Delete&nbsp;all&nbsp;rows&nbsp;in&nbsp;a&nbsp;table<br /></span><span style="color: #0000BB">mssql_query</span><span style="color: #007700">(</span><span style="color: #DD0000">'TRUNCATE&nbsp;TABLE&nbsp;[php].[dbo].[persons]'</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">'Deleted&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">mssql_rows_affected</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">'&nbsp;row(s)'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mssql-result.html">mssql_result</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mssql-select-db.html">mssql_select_db</a></div>
 <div class="up"><a href="ref.mssql.html">Mssql 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
